import { EntityModel } from '@midwayjs/orm';
import  {xsEntity} from '../commentity';
import {  ManyToOne } from 'typeorm';
import { AdminEntity } from './user';
import { BaseSysRoleEntity } from './role';

/**
 * 用户角色
 */
@EntityModel('base_sys_user_role')
export class BaseSysUserRoleEntity extends xsEntity {
  // @Column({ comment: '用户ID', type: 'bigint' })
  // userId: number;
  @ManyToOne(() => AdminEntity, AdminEntity => AdminEntity.roles)
  userId: AdminEntity;


  // @Column({ comment: '角色ID', type: 'bigint' })
  // roleId: number;
  @ManyToOne(()=>BaseSysRoleEntity, BaseSysRoleEntity=>BaseSysRoleEntity.id)
  role: BaseSysRoleEntity;


}
